package persistence;

public class BindingOrder {
	private int id=0;
	private BindingDetails bindingDetails;
	private Boolean isDone;
	private Volume volume;
	private Bookbinder bookbinder;
	
	protected BindingOrder(){};
	
	protected BindingOrder(int id, BindingDetails bindingDetails, Boolean isDone,
							Volume vol, Bookbinder bbinder) {
		setId(id);
		setBindingDetails(bindingDetails);
		setIsDone(isDone);
		setVolume(vol);
		setBookbinder(bbinder);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((bindingDetails == null) ? 0 : bindingDetails.hashCode());
		result = prime * result
				+ ((bookbinder == null) ? 0 : bookbinder.hashCode());
		result = prime * result + id;
		result = prime * result + ((volume == null) ? 0 : volume.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BindingOrder other = (BindingOrder) obj;
		if (bindingDetails == null) {
			if (other.bindingDetails != null)
				return false;
		} else if (!bindingDetails.equals(other.bindingDetails))
			return false;
		if (bookbinder == null) {
			if (other.bookbinder != null)
				return false;
		} else if (!bookbinder.equals(other.bookbinder))
			return false;
		if (id != other.id)
			return false;
		if (volume == null) {
			if (other.volume != null)
				return false;
		} else if (!volume.equals(other.volume))
			return false;
		return true;
	}

	public int getId() {
		return id;
	}

	public BindingDetails getBindingDetails() {
		return bindingDetails;
	}

	public Boolean getIsDone() {
		return isDone;
	}

	public Volume getVolume() {
		return volume;
	}

	public Bookbinder getBookbinder() {
		return bookbinder;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setBindingDetails(BindingDetails bindingDetails) {
		this.bindingDetails = bindingDetails;
	}

	public void setIsDone(Boolean isDone) {
		this.isDone = isDone;
	}

	public void setVolume(Volume volume) {
		this.volume = volume;
	}

	public void setBookbinder(Bookbinder bookbinder) {
		this.bookbinder = bookbinder;
	}
	
	

}
